/*
 * SchlaboMIDlet.java
 *
 * Created on 21. November 2006, 13:45
 */
package com.mopius.game;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

/**
 *
 * @author  Andreas Jakl
 */
public class SchlaboMIDlet extends MIDlet
{

    private Display iDisplay;
    private boolean iFirstStart = true;
    private PlayCanvas iCanvas;

    public SchlaboMIDlet()
    {
    }

    public void startApp()
    {
        if (iFirstStart)
        {
            iDisplay = Display.getDisplay(this);
            iCanvas = new PlayCanvas(this);
            iCanvas.init();
            iDisplay.setCurrent(iCanvas);
            iFirstStart = false;
        }
    }

    public void pauseApp()
    {
    }

    public void destroyApp(boolean unconditional)
    {
        if (iCanvas != null)
        {
            iCanvas.stop();
        }
    }

    public void exit()
    {
        destroyApp(true);
        notifyDestroyed();
    }
}
